import {
	request,
} from '@/api/request';
const apiList = [{
		name: 'sms',
		url: '/api/sms'
	},{
		name: 'wx_bind',
		url: '/api/wx_bind'
	},{
		name: 'wx_decrypt',
		url: '/api/wx_decrypt'
	},{
		name: 'wx_login',
		url: '/api/wx_login'
	},
	{
		name:'userinfo',
		url:'/api/user/info',
		method:'GET'
	},
	{
		// api/user/collect
		name:'collect',
		url:'/api/user/collect',
		method:'GET'
	},
	{
		// /api/user/history_school
		name:'history_school',
		url:'/api/user/history_school',
		method:'GET'
	},
	{
		// /api/school/cancel_collect
		name: 'cancel_collect',
		url: '/api/school/cancel_collect',
	}
]


module.exports = apiList.reduce((mode, params) => {
	mode[params.name] = (data, token) => request({
		url: params.url,
		method: params.method || 'POST',
		data,
		token,
		showlod:params.showlod
	})
	return mode
}, {})